package com.dap.test;

import com.dap.dubbo.rpc.config.RedisConfig;
import org.junit.Before;
import org.junit.Test;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import redis.clients.jedis.Jedis;

public class App {

    private RedisConfig redisConfig;
    @Before
    public void before() {
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(new String[]{"dubbo-test.xml"});
        redisConfig = (RedisConfig) context.getBean("redisConfig", RedisConfig.class);
    }


    @Test
    public void test() {
       for(int i=0;i<100;i++){
           Jedis jedis= RedisConfig.getJedis();
           System.out.println(i+"==="+jedis.get("hello"));
           jedis.close();
       }

    }
}
